-- GENERATED SPELL FOR [Illidari Defiler] --


function spell0_22853(pUnit, Event) --@Banish,n/a--
pUnit:FullCastSpellOnTarget(39674,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22853', 16000, 1)
end

function spell1_22853(pUnit, Event) --@Curse of Agony,n/a--
pUnit:FullCastSpellOnTarget(39672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22853', 30000, 1)
end

function spell2_22853(pUnit, Event) --@Fel Immolate,n/a--
pUnit:FullCastSpellOnTarget(39670,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22853', 17000, 1)
end

function spell3_22853(pUnit, Event) --@Rain of Chaos,n/a--
pUnit:FullCastSpellOnTarget(39671,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22853', 6000, 1)
end

function Sorts_22853(pUnit, Event)
local choix_sorts_22853 = math.random(0, 3)
if choix_sorts_22853 == 0 then
pUnit:RegisterEvent('spell0_22853', 1, 1)
end
if choix_sorts_22853 == 1 then
pUnit:RegisterEvent('spell1_22853', 1, 1)
end
if choix_sorts_22853 == 2 then
pUnit:RegisterEvent('spell2_22853', 1, 1)
end
if choix_sorts_22853 == 3 then
pUnit:RegisterEvent('spell3_22853', 1, 1)
end
end

function mob22853_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22853', math.random(1500, 3000), 1)
end

function mob22853_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22853_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22853_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22853, 1, 'mob22853_Action')
RegisterUnitEvent(22853, 2, 'mob22853_Leave')
RegisterUnitEvent(22853, 3, 'mob22853_Kill')
RegisterUnitEvent(22853, 4, 'mob22853_Die')
